﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            

            Queue queue2 = new Queue(30);
            queue2.Enqueue("老王");
            queue2.Enqueue("张三");
            queue2.Enqueue("李四");
            var que = queue2.ToArray();
            foreach (var item in que)
            {
                Console.WriteLine(item);
            }
       
            

            Queue queue = new Queue();
            queue.Enqueue("aaa");
            queue.Enqueue("bbb");
            queue.Enqueue("ccc");

            var que1 = queue.ToArray();
            foreach (var item1 in que1)
            {
                Console.WriteLine(item1);
            }

            IEnumerator enumerator = queue.GetEnumerator();
            while (enumerator.MoveNext())
            {
                Console.WriteLine(enumerator.Current);
            }
        }
    }
}
